package com.ruoyi.common.utils;

import com.ruoyi.common.core.domain.hospital.MrInData;
import com.ruoyi.common.core.domain.hospital.PostResult;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import java.io.StringReader;

public class PostReturnUtils {

    public static PostResult postResult(String data) throws JAXBException {
        PostResult postResult = null;
        try {

            JAXBContext jaxbContext = JAXBContext.newInstance(PostResult.class);

            Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
            StringReader reader = new StringReader(data);
            postResult = (PostResult) jaxbUnmarshaller.unmarshal(reader);

        } catch (JAXBException e) {
            e.printStackTrace();
        }
        return postResult;
    }
}
